package com.ruoyi.framework.jwt.domain;

import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * 用户Token对象 sys_user_token
 * 
 * @author ruoyi
 * @date 2024-01-01
 */
public class SysUserToken extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** Token ID */
    private String tokenId;

    /** 用户ID */
    @Excel(name = "用户ID")
    private Long userId;

    /** 访问Token */
    @Excel(name = "访问Token")
    private String accessToken;

    /** 刷新Token */
    @Excel(name = "刷新Token")
    private String refreshToken;

    /** 访问Token过期时间 */
    @Excel(name = "访问Token过期时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date accessTokenExpire;

    /** 刷新Token过期时间 */
    @Excel(name = "刷新Token过期时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date refreshTokenExpire;

    /** 设备类型 */
    @Excel(name = "设备类型")
    private String deviceType;

    /** 设备ID */
    @Excel(name = "设备ID")
    private String deviceId;

    /** 登录IP地址 */
    @Excel(name = "登录IP地址")
    private String ipaddr;

    /** 用户代理 */
    @Excel(name = "用户代理")
    private String userAgent;

    /** 登录地点 */
    @Excel(name = "登录地点")
    private String loginLocation;

    /** 状态（0正常 1停用 2已注销） */
    @Excel(name = "状态", readConverterExp = "0=正常,1=停用,2=已注销")
    private String status;

    /** 注销原因 */
    @Excel(name = "注销原因")
    private String revokeReason;

    public void setTokenId(String tokenId)
    {
        this.tokenId = tokenId;
    }

    public String getTokenId()
    {
        return tokenId;
    }

    public void setUserId(Long userId)
    {
        this.userId = userId;
    }

    public Long getUserId()
    {
        return userId;
    }

    public void setAccessToken(String accessToken)
    {
        this.accessToken = accessToken;
    }

    public String getAccessToken()
    {
        return accessToken;
    }

    public void setRefreshToken(String refreshToken)
    {
        this.refreshToken = refreshToken;
    }

    public String getRefreshToken()
    {
        return refreshToken;
    }

    public void setAccessTokenExpire(Date accessTokenExpire)
    {
        this.accessTokenExpire = accessTokenExpire;
    }

    public Date getAccessTokenExpire()
    {
        return accessTokenExpire;
    }

    public void setRefreshTokenExpire(Date refreshTokenExpire)
    {
        this.refreshTokenExpire = refreshTokenExpire;
    }

    public Date getRefreshTokenExpire()
    {
        return refreshTokenExpire;
    }

    public void setDeviceType(String deviceType)
    {
        this.deviceType = deviceType;
    }

    public String getDeviceType()
    {
        return deviceType;
    }

    public void setDeviceId(String deviceId)
    {
        this.deviceId = deviceId;
    }

    public String getDeviceId()
    {
        return deviceId;
    }

    public void setIpaddr(String ipaddr)
    {
        this.ipaddr = ipaddr;
    }

    public String getIpaddr()
    {
        return ipaddr;
    }

    public void setUserAgent(String userAgent)
    {
        this.userAgent = userAgent;
    }

    public String getUserAgent()
    {
        return userAgent;
    }

    public void setLoginLocation(String loginLocation)
    {
        this.loginLocation = loginLocation;
    }

    public String getLoginLocation()
    {
        return loginLocation;
    }

    public void setStatus(String status)
    {
        this.status = status;
    }

    public String getStatus()
    {
        return status;
    }

    public void setRevokeReason(String revokeReason)
    {
        this.revokeReason = revokeReason;
    }

    public String getRevokeReason()
    {
        return revokeReason;
    }

    @Override
    public String toString()
    {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
            .append("tokenId", getTokenId())
            .append("userId", getUserId())
            .append("accessToken", getAccessToken())
            .append("refreshToken", getRefreshToken())
            .append("accessTokenExpire", getAccessTokenExpire())
            .append("refreshTokenExpire", getRefreshTokenExpire())
            .append("deviceType", getDeviceType())
            .append("deviceId", getDeviceId())
            .append("ipaddr", getIpaddr())
            .append("userAgent", getUserAgent())
            .append("loginLocation", getLoginLocation())
            .append("status", getStatus())
            .append("revokeReason", getRevokeReason())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}